<?php
/**
 * Created by PhpStorm.
 * User: shiding
 * Date: 2019-06-14
 * Time: 17:03
 */

namespace App\Http\Repositories;


use App\Models\ProjectType;

class ProjectTypeRepository
{
    protected $projectTypeModel;

    public function __construct(ProjectType $projectType)
    {
        $this->projectTypeModel = $projectType;
    }

    public function getList()
    {
        return $this->projectTypeModel->get();
    }

    public function edit($params, $id = 0)
    {
        return $id
            ? $this->projectTypeModel->insert($params)
            : $this->projectTypeModel->where("id", $id)->update($params);
    }

    public function del($id)
    {
        return $this->projectTypeModel->destroy($id);
    }

    public function changeEnable($id, $status)
    {
        return $this->projectTypeModel->changeEnable($id, $status);
    }

    public function getType($isCount = false)
    {
       return $this->projectTypeModel->getTypeList($isCount);
    }
}